package main

import "fmt"

func main() {
	m := make(map[string]int)
	m["k1"] = 7
	m["k2"] = 13
	fmt.Println("map:", m)

	v1 := m["k1"]
	fmt.Println("v1: ", v1)

	fmt.Println("len:", len(m))

	delete(m, "k2")
	fmt.Println("map:", m)

	// TODO 此处为判断空处理
	_, prs := m["k2"]

	fmt.Println("prs:", prs)

	prs2 := m["k1"]
	fmt.Println("prs2:", prs2)

	n := map[string]int{"foo": 1, "bar": 2}
	fmt.Println("map:", n)

	//只获取函数返回值的后两个
	_, numb, strs := numbers()
	fmt.Println(numb, strs)

}

//一个可以返回多个值的函数
func numbers() (a int, b int, c string) {
	a, b, c = 1, 2, "str"
	return
}
